# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: views.py
@time: 2021/12/1 10:49
'''

from django.http import JsonResponse
from django.contrib.auth.mixins import LoginRequiredMixin


# 验证用户是否登录(创建类视图时直接继承这个类)
class LoginRequiredJSONMixin(LoginRequiredMixin):
    def handle_no_permission(self):
        return JsonResponse({'code':400,'errmsg':'用户未登录'})